indir <- "/data1/bsi/BORA_processing/devel/data_HTHGU/illumina1/MayoGAP/mayogap_emerge/raw/clean/beagle/run_beagle/chr22/1000samples"
setwd(indir)
inFile <- file('whole_default/beagle_out_chr22.geno.bgl.gz.gprobs','r')
fileConn<-file("output.txt",'w')
while(length(input<-readLines(inFile, n=1)))
{
	input<-unlist(strsplit(input, " "))
	print(input[1])
	writeLines(paste(input,collapse=" "), fileConn)
}
close(inFile)
close(fileConn)
